<?php
include APPPATH."views/frontend/inc/01_meta.php";
include APPPATH."views/frontend/inc/02_head.php";
include APPPATH."views/frontend/inc/04_slider.php";
?>

<div class="navi">
	<a href="/home">Trang chủ</a>
	<span>/</span>
	<span class="active">Sản phẩm</span>
	<div class="clear"></div>
	<?php include APPPATH."views/frontend/inc/05_social.php"; ?>
</div>

<!--
<script src="/libraries/lightgallery/js/lightGallery.js"></script>
<link rel="stylesheet"  href="/libraries/lightgallery/css/lightGallery.css"/>
-->
<script type="text/javascript">
	$(document).ready(function() {
		//$(".cake-item .nailthumb").lightGallery({
		//    caption:true,rel:true
		//}); 
		
	});
</script>
<div class="container">
	<div class="col-xs-12 page-title">SẢN PHẨM</div>
	<div class="clear"></div>
	<div >
	<?php 
		foreach($products as $cake){ 
			$thumb = $cake->product_thumb;
			$thumb = preg_replace('/\/data/','',$thumb,1);
			if(file_exists(APPPATH. "../data/thumbs/$thumb") && is_file(APPPATH. "../data/thumbs/$thumb")){
				$cake->small_thumb = "/data/thumbs$thumb";
			}else{
			$cake->small_thumb = $cake->product_thumb;
			}
	?>
		<div class="col-md-4 col-sxs-6">
			<div class="cake-item">
				<a class="swipebox" 
					title="<?php echo $cake->product_title?>" 
					href="<?php echo $cake->product_thumb?>">
					<div class="nailthumb flip-container" data-rel="imageGallery">
						<div class="nailthumb-figure"
							data-title="<?php echo $cake->product_title?>" 
							data-src="<?php echo $cake->product_thumb?>"
							>
							<div class="nailthumb-container">
								<div class="front">
									<img class="flu lazy" data-original="<?php echo $cake->small_thumb?>"
										alt="<?php echo $cake->product_title?>"
										title="<?php echo $cake->Title?>"
										/>
								</div>
								<div class="back">
									<img class="flu wp-image-55 lazy" data-original="<?php echo $cake->small_thumb?>"
										alt="<?php echo $cake->product_title?>"
										title="<?php echo $cake->product_title?>"
										/>
								</div>
							</div>
							<?php if(!empty($cake->product_price_vi)){ ?>
							<div class="nailthumb-mark">
								<div class="cake-price"><?php echo $cake->product_price_vi;?></div>
							</div>
							<?php } ?>
						</div>
					</div>
				</a>
				<div>
					<h1 class="cake-title"><?php echo $cake->product_title?></h1>
					<div class="cake-desc"><?php echo $cake->product_desc?></div>
				</div>
			</div>
		</div>
	<?php } ?>
	</div>
</div>
<?php
include APPPATH."views/frontend/inc/03_foot.php";
?>